package com.woniu.micropropertyserver.controller;

import com.github.pagehelper.PageInfo;
import com.woniu.microcommonsserver.entity.CarPassInfoEntity;
import com.woniu.microcommonsserver.entity.PassCarCheckEntity;
import com.woniu.micropropertyserver.bean.DeployParkCCheck;
import com.woniu.micropropertyserver.service.IPassCarCheckService;
import com.woniu.micropropertyserver.service.IPassCarInfoService;
import com.woniu.micropropertyserver.util.PageRest;
import com.woniu.micropropertyserver.util.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author ：bb
 * @date ：Created in 2021/2/2 0002
 * @description：
 * @modified By：
 * @version: $
 */
@RequestMapping("/passCarInfo")
@RestController
public class PassCarInfoController {
    @Autowired
    private IPassCarInfoService passCarInfoServiceImpl;

    @GetMapping(value = "/findByParams",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResultMsg findByParam(PageRest pageRest , CarPassInfoEntity carPassInfoEntity){
        System.out.println(carPassInfoEntity);
        PageInfo<CarPassInfoEntity> info = passCarInfoServiceImpl.findByParam(pageRest,carPassInfoEntity);
        return  new ResultMsg(200,"操作成功",info);
    }


    @GetMapping(value = "/findByCarNum",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResultMsg findByNum(String passCarNum){
        System.out.println(passCarNum);
        CarPassInfoEntity check =passCarInfoServiceImpl.findByNum(passCarNum);

        return  new ResultMsg(200,"查找成功",check);

    }
    @GetMapping(value = "/export",produces = MediaType.APPLICATION_JSON_VALUE)
    public ResultMsg Export(CarPassInfoEntity carPassInfoEntity){
        System.out.println(carPassInfoEntity);
        List<CarPassInfoEntity> check =passCarInfoServiceImpl.ExportAll(carPassInfoEntity);
        return  new ResultMsg(200,"导出成功",check);

    }


}
